package cn.wen.yinxiu.member.dao;

import cn.wen.yinxiu.member.entity.UsersEntity;
import cn.wen.yinxiu.common.to.user.UserDataInfo;
import cn.wen.yinxiu.member.vo.ChannelUserVo;
import cn.wen.yinxiu.member.vo.UserVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 用户表
 *
 * @ClassName: UsersDao
 * @Author 小飞
 * @Email coderwen22@163.com
 * @Date 2023-05-21 22:19:26
 * @Description: 用户Dao层
 */
@Component
@Mapper
public interface UsersDao extends BaseMapper<UsersEntity> {

    /**
     * 通过名称和隐身
     *
     * @param req
     * @return
     */
    List<UserVO> queryChannelUserList(@Param("req") ChannelUserVo req);

    /**
     * 模糊查询用户账号 或者 用户名称
     *
     * @param account
     * @param searchKey
     * @return
     */
    List<UsersEntity> queryFuzzyUserList(@Param("account") String account,
                                         @Param("searchKey") String searchKey);

    /**
     * 获取用户ID
     *
     * @param status
     * @param isDeleted
     * @return
     */
    List<UserDataInfo> getUserIdList(@Param("status") Integer status,
                                     @Param("isDeleted") Integer isDeleted);

    /**
     * 随机获取
     *
     * @param status
     * @param isDeleted
     * @return
     */
    List<Long> getUserIdFind30(@Param("status") Integer status,
                               @Param("isDeleted") Integer isDeleted);

    /**
     * 获取用户关注列表
     *
     * @param userId
     * @param status
     * @param isDeleted
     * @return
     */
    List<Long> queryUserFollowIdList(@Param("userId") Long userId,
                                     @Param("status") Integer status,
                                     @Param("isDeleted") Integer isDeleted);


}
